/*
 * Copyright (c) 2023 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#ifndef GEN_NETWORK_PORT_METRICS_INTERFACE_H
#define GEN_NETWORK_PORT_METRICS_INTERFACE_H

#include <device_tree/base.h>

namespace dev::gen {

class MC_API NetworkPort_Metrics : public mc::engine::interface<NetworkPort_Metrics> {
public:
    MC_INTERFACE("bmc.dev.NetworkPort.Metrics")

    property<uint64_t> RXFrames;              ///< 接收到的总帧数
    property<uint64_t> TXFrames;              ///< 发送的总帧数
    property<uint64_t> RXUnicastFrames;       ///< 接收的单播帧数
    property<uint64_t> RXMulticastFrames;     ///< 接收的组播帧数
    property<uint64_t> RXBroadcastFrames;     ///< 接收的广播帧数
    property<uint64_t> TXUnicastFrames;       ///< 发送的单播帧数
    property<uint64_t> TXMulticastFrames;     ///< 发送的组播帧数
    property<uint64_t> TXBroadcastFrames;     ///< 发送的广播帧数
    property<uint64_t> RXFCSErrors;           ///< 接收到的帧校验序列错误数
    property<uint64_t> RXFrameAlignmentErrors;///< 接收到的帧对齐错误数
    property<uint64_t> RXFalseCarrierErrors;  ///< 接收到的虚假载波错误数
    property<uint64_t> RXUndersizeFrames;     ///< 接收到的超短帧数
    property<uint64_t> RXOversizeFrames;      ///< 接收到的超长帧数
    property<uint64_t> RXPauseXOFFFrames;     ///< 接收到的 XOFF 暂停帧数
    property<uint64_t> RXPauseXONFrames;      ///< 接收到的 XON 暂停帧数
    property<uint64_t> TXPauseXOFFFrames;     ///< 发送的 XOFF 暂停帧数
    property<uint64_t> TXPauseXONFrames;      ///< 发送的 XON 暂停帧数
    property<uint64_t> TXSingleCollisions;    ///< 发送的单次冲突帧数
    property<uint64_t> TXMultipleCollisions;  ///< 发送的多次冲突帧数
    property<uint64_t> TXLateCollisions;      ///< 发送的迟冲突帧数
    property<uint64_t> TXExcessiveCollisions; ///< 发送的过度冲突丢弃帧数
    property<double>   BandwidthPercent;      ///< 网络带宽利用率百分比
    property<uint64_t> PacketsDropped;        ///< 丢包总数
};
} // namespace dev::gen

#endif // GEN_NETWORK_PORT_METRICS_INTERFACE_H